Using sprintf "%.2f" to output the final percentage
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Thu, 21 Apr 2005 03:59:26 +0000 (03:59 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Thu, 21 Apr 2005 03:59:26 +0000 (03:59 +0000)
maintenance/parserTests.php

index b574bda..4443334 100644 (file)
@@ -187,7 +187,7 @@ class ParserTest {
                        }
                }
                if( $total > 0 ) {
-                       $ratio = IntVal( 100.0 * $success / $total );
+                       $ratio = sprintf( "%.2f", 100 * $success / $total );
                        print $this->termColor( 1 ) . "\nPassed $success of $total tests ($ratio%) ";
                        if( $success == $total ) {
                                print $this->termColor( 32 ) . "PASSED!";